Skip to content

Leave DTS gRPC send limit unset by default - #198

Merged
Bernd Verst (berndverst) merged 9 commits into
mainfrom
berndverst-align-grpc-message-limits
Nov 23, 2026
Merged

Bernd Verst (berndverst) merged 9 commits into
mainfrom
berndverst-align-grpc-message-limits

Conversation

@berndverst

@berndverst Bernd Verst (berndverst) commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Summary

Stops the DTS connection from imposing an SDK-side gRPC send limit by default, leaving outgoing message-size enforcement to the server. The 64 MiB receive limit is unchanged.

Changes compared to main

main This PR
MaxReceiveMessageSize default 64 MiB 64 MiB (unchanged)
MaxSendMessageSize default 64 MiB (grpc.MaxCallSendMsgSize always set) 0 – SDK does not set a send limit
Positive MaxSendMessageSize Applied Applied (opt-in client-side limit)
Orchestration response bound ~3.9 MiB, lowered by send limit ~3.9 MiB, lowered only by a positive send limit
  • durabletaskscheduler/options.go – DefaultMaxSendMessageSize is now 0; option docs describe receive limits as per-message (unary responses and individual stream chunks) and the send limit as optional.
  • durabletaskscheduler/connection.go – grpc.MaxCallSendMsgSize is only added when MaxSendMessageSize > 0; a zero value is no longer replaced with a default.
  • durabletaskscheduler/worker.go – the orchestration-response bound stays at DefaultMaxOrchestratorCompletionBytes (~3.9 MiB) and is lowered only by a positive send limit.
  • durabletaskscheduler/connection_test.go – covers: no send option by default, explicit send limits enforced locally, oversized sends rejected by the server's receive limit, and 64 MiB receive behavior for unary and streamed messages.
  • README / CHANGELOG – document the receive vs. send semantics and the separate orchestration-response bound.

Notes

  • With no SDK send option, gRPC-Go's own default maximum (math.MaxInt32, ~2 GiB) still applies; in practice the DTS server's 4 MiB receive limit is the effective bound.
  • Activity and entity completions are not size-checked by the worker, matching the .NET SDK, which only bounds orchestration responses.

Validation

  • go vet ./...
  • go test -count=1 ./...

Bernd Verst and others added 5 commits November 23, 2026 11:25
Default MaxReceiveMessageSize/MaxSendMessageSize to 4 MiB instead of 64 MiB,
matching the DTS service limit for unary calls and each streamed message.

Bound activity and entity completions with the same worker completion bound
as orchestration responses. Oversized results now fail with non-retriable
ActivityResponseTooLarge / EntityResultTooLarge instead of being abandoned
and re-executed indefinitely.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Add worker-path tests for oversized activity and entity completions, with
and without large-payload externalization, plus gRPC tests for the send
limit and per-message stream receive limit.

Correct the docs: DTS enforces 4 MiB only on messages it receives; its
history chunks target about 2 MiB, and the receive default matches the
.NET worker.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
DTS keeps every message it sends, including history chunks, within the default 4 MiB gRPC limit; drop the advice to raise MaxReceiveMessageSize.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 23, 2026 19:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified that would block approval.

No open issues 🎉

What changed in this PR

This PR aligns Durable Task Scheduler (DTS) connections with 4 MiB per-message defaults and extends worker completion-size checks to activities and entities.

Changes:

  • Reduce default gRPC send and receive limits from 64 MiB to 4 MiB, without changing the total streamed-history limit.
  • Convert oversized activity and entity completions into non-retriable failures after large-payload externalization.
  • Add boundary, override, streaming, and worker-path tests, and document the updated behavior.
File Description
durabletaskscheduler/​README.md Documents message limits and oversized-completion behavior.
durabletaskscheduler/​options.go Sets default send and receive limits to 4 MiB.
durabletaskscheduler/​connection_test.go Tests message boundaries, configured overrides, and per-message streaming limits.
client/​grpc_worker.go Documents that the completion bound covers all work item types.
client/​grpc_worker_test.go Tests oversized activity and entity completions with and without externalization.
client/​grpc_worker_processor.go Replaces oversized activity and entity completions with failure responses.
CHANGELOG.md Records the new defaults and completion behavior.
api/​failure.go Adds activity and entity oversized-completion error types.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 23, 2026 21:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the message-limit and oversized-completion changes.

No open issues 🎉

Review effort: Balanced

Restore the 64 MiB receive default and leave the transport send limit unset unless explicitly configured. Retain the worker completion safety cap and cover default, explicit, and server-enforced message limits.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 23, 2026 21:25
@berndverst Bernd Verst (berndverst) changed the title Align DTS gRPC message limits with 4 MiB defaults Leave DTS transport send limits unset and guard worker completions Nov 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the changes separating transport send limits from worker completion safeguards.

No open issues 🎉

Review effort: Balanced

@berndverst Bernd Verst (berndverst) changed the title Leave DTS transport send limits unset and guard worker completions Defer transport send limits and guard activity/entity completions Nov 23, 2026
Match the .NET SDK, which only bounds orchestration responses.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 23, 2026 21:32
@berndverst Bernd Verst (berndverst) changed the title Defer transport send limits and guard activity/entity completions Leave DTS gRPC send limit unset by default Nov 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The optional gRPC send-limit change has no active review issues blocking approval.

No open issues 🎉

Review effort: Balanced

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 23, 2026 21:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block approval of the SDK’s default gRPC send-limit change.

No open issues 🎉

Review effort: Balanced

@berndverst
Bernd Verst (berndverst) merged commit 198b7cf into main Nov 23, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants